package customview.ike.com.customviewproject.widget.customLayoutManager;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper;

import java.util.ArrayList;
import java.util.List;

import customview.ike.com.customviewproject.R;
import customview.ike.com.customviewproject.utils.recycleViewCommonUtils.MultiItemAdapter.ItemViewDelegate;
import customview.ike.com.customviewproject.utils.recycleViewCommonUtils.MultiItemAdapter.MultiItemTypeAdapter;

/**
 * Created by Administrator on 2018/1/8.
 */

public class LayoutManagerActivity extends AppCompatActivity {
    private RecyclerView rl;
    private List<String> strings=new ArrayList<>();
    //private MyAdapter myAdapter;
    private ItemTouchHelper itemTouchHelper;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_layout_manager);
        rl= (RecyclerView) findViewById(R.id.rl);
        for (int i = 0; i <20 ; i++) {
            strings.add("我是条目："+i);
        }
//        myAdapter = new MyAdapter(strings);
//        itemTouchHelper=new ItemTouchHelper(new TanTanLayoutManager.CardItemTouchHelperCallBack(strings,myAdapter));
//        itemTouchHelper.attachToRecyclerView(rl);
//        rl.setLayoutManager(new TanTanLayoutManager(itemTouchHelper,rl));
//        rl.setAdapter(myAdapter);
        
    }
//    public class  MyAdapter extends MultiItemTypeAdapter<String>{
//
//        public MyAdapter(List<String> mData) {
//               super(mData);
//               addItemViewDelegate(new MyDelegate());
//        }
//    }
//    public class MyDelegate extends ItemViewDelegate<String,SimpaleItemBinding>{
//
//        @Override
//        public int getItemViewLayoutId() {
//            return R.layout.simpale_item;
//        }
//
//        @Override
//        public boolean isRightViewType(String item, int position) {
//            return true;
//        }
//
//        @Override
//        public void convert(MultiItemTypeAdapter.ViewHolder viewHolder, String item, int position) {
//            bind.tv.setText(item);
//
//        }
//    }
}
